package com.gl.saasservice.sys.controller;

import com.gl.common.vo.ResultBean;
import com.gl.framework.web.response.Result;
import com.gl.saasservice.sys.service.FeedbackService;
import com.gl.saasservice.sys.vo.CardWarehouseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 意见反馈
 */
@Controller
@RequestMapping("/feedback")
@Api(tags = "意见反馈接口")
public class FeedbackController {

    @Autowired
    private FeedbackService feedbackService;

    /**
     * 意见反馈列表
     * @param token
     * @return
     */
    @GetMapping("/list")
    @ResponseBody
    @ApiOperation("查询用户意见反馈")
    public Result list(@RequestHeader String token,
                       @RequestParam(defaultValue = "0") Integer pageNumber, @RequestParam(defaultValue = "5") Integer pageSize,
                       @RequestParam(name = "type",required = false) Integer type) {
        return feedbackService.list(token,pageNumber,pageSize,type);
    }

    /**
     * 意见反馈消息已读
     */
    @PutMapping("readFeedback")
    @ResponseBody
    public Result readFeedback(@RequestHeader String token,
                               @RequestBody Long[] Ids) {
        return feedbackService.readFeedback(token,Ids);

    }

}
